from typing import List, Dict, Callable, Any


get_sub_dict: Callable = lambda d, key_list, default = "": (d if d else default) if (
        not key_list or not d) else get_sub_dict(d.get(key_list[0], {}), key_list[1:], default=default)


def get_value(d: Dict, key_list: List[str], default: Any = ""):
    """
    获取多层字典下指定路径下的值
    :param d:
    :param key_list:
    :param default: 默认返回值
    :return:
    """
    return get_sub_dict(d=d, key_list=key_list, default=default)


